We will look at two definitions for an ellipse.
Definition 1: An ellipse is a closed curve about two focal points. These are labeled $F_{1}$ & $F_{2}$ in Fig 1. At every point, $P$, on the curve, the sum of the distances to the two focal points is a constant equal to twice the distance from the ellipse center to the most distant point on the ellipse. We name that distance variable $a$ and also call it the semi-major axis. $$\mathrm{2a=\Vert P-F_{1}\Vert+\Vert P-F_{2}\Vert} \tag{1} \label{1}$$
Definition 2: Any conic is the locus of points whose distance to a point (the focus) and a line (the directrix) is a constant ratio. In the case of an ellipse, that ratio is $\mathrm{e}$ for eccentricity and since there are two focal points, there are two directrix lines for each ellipse, but the equation only uses the directrix that is closest to the chosen focal point. The equation is $$e=\frac{\Vert P-F\Vert}{\Vert P-A\Vert} \quad 0\lt e \lt 1 \tag{2} \label{2}$$
The semi-major axis, $a$, is the longest straight line distance from the center to an edge. The semi-minor axis, $b$, is a perpendicular to the semi-major axis from the center to the edge. A common equation for an ellipse with center $(h,k)$ is $$\frac{(x-h)^{2}}{a^{2}}+\frac{(y-k)^{2}}{b^{2}}=1 \tag{3} \label{3}$$ This is the usual Cartesian form of an ellipse. If we get an ellipse equation in general form, then we may have to try and get it into this form in order to find $h,\,k,\,a$ and $b$. If it has an $xy$ term, then it is not aligned with an axis and it gets complicated. Given the "general form:" $$Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0,$$ then $$\text{semi-major/minor axis}=\left[\frac{2\left(\frac{AE^{2}-BDE+CD^{2}}{4AC-B^{2}}-F\right)}{\left(A+C\pm\sqrt{\left(A-C\right)^{2}+B^{2}}\right)}\right]^{1/2}. \tag{4} \label{4}$$
In $\eqref{4}$, the semi-major axis, $a$, has the smaller denominator and goes with the negative denominator radical. Although this equation will yield a correct result, we would never choose to remember it and its most reasonable use might be in code. Equations like $\eqref{4}$ above can be found at Wikipedia Ellipse.
The larger axis is always labeled $a$. When there is no $xy$ term, then we can complete the square for both $x$ and $y$ followed by dividing through by the right side to get $1$ and obtain the form of $\eqref{3}$.
Understanding the ellipse is step one for studying orbital mechanics. For example, when two bodies orbit one another, such as the earth and the moon, they share one foci, called a barycenter, and each has a second foci which is unique to it. Regardless of relative size of the two bodies, they both orbit the shared focal point. For additional information, look up the 2-body problem of classical mechanics.